/*    */ package com.zimbra.cs.datasource.imap;
/*    */ 
/*    */ import java.util.Collection;
/*    */ import java.util.HashMap;
/*    */ import java.util.Iterator;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ImapFolderCollection
/*    */   implements Iterable<ImapFolder>
/*    */ {
/*    */   private final Map<Integer, ImapFolder> mByItemId;
/*    */   private final Map<String, ImapFolder> mByLocalPath;
/*    */   private final Map<String, ImapFolder> mByRemotePath;
/*    */   
/*    */   public ImapFolderCollection()
/*    */   {
/* 31 */     this.mByItemId = new HashMap();
/* 32 */     this.mByLocalPath = new HashMap();
/* 33 */     this.mByRemotePath = new HashMap();
/*    */   }
/*    */   
/*    */   public void add(ImapFolder imapFolder) {
/* 37 */     this.mByLocalPath.put(imapFolder.getLocalPath().toLowerCase(), imapFolder);
/* 38 */     this.mByRemotePath.put(imapFolder.getRemoteId(), imapFolder);
/* 39 */     this.mByItemId.put(Integer.valueOf(imapFolder.getItemId()), imapFolder);
/*    */   }
/*    */   
/*    */   public void remove(ImapFolder imapFolder) {
/* 43 */     this.mByLocalPath.remove(imapFolder.getLocalPath().toLowerCase());
/* 44 */     this.mByRemotePath.remove(imapFolder.getRemoteId());
/* 45 */     this.mByItemId.remove(Integer.valueOf(imapFolder.getItemId()));
/*    */   }
/*    */   
/*    */   public ImapFolder getByLocalPath(String localPath) {
/* 49 */     return (ImapFolder)this.mByLocalPath.get(localPath.toLowerCase());
/*    */   }
/*    */   
/*    */   public ImapFolder getByRemotePath(String remotePath) {
/* 53 */     return (ImapFolder)this.mByRemotePath.get(remotePath);
/*    */   }
/*    */   
/*    */   public ImapFolder getByItemId(int itemId) {
/* 57 */     return (ImapFolder)this.mByItemId.get(Integer.valueOf(itemId));
/*    */   }
/*    */   
/*    */   public int size() {
/* 61 */     return this.mByItemId.size();
/*    */   }
/*    */   
/*    */   public Iterator<ImapFolder> iterator() {
/* 65 */     return this.mByItemId.values().iterator();
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/datasource/imap/ImapFolderCollection.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */